package com.borya.action;

import com.alibaba.fastjson.JSONObject;
import com.borya.framework.core.ServerRequest;
import com.borya.model.db.User;

public abstract class BaseAction {

	protected JSONObject getJson(ServerRequest request) {
		if(request == null){
			return null;
		}
		
		return (JSONObject)request.getAttribute("json");
}
	
	protected User getUser(ServerRequest request) {
		if(request == null){
			return null;
		}
		return (User)request.getAttribute("user");
	}
	
}